// 类型别名(可充当变量、函数)
type Handler = () => void;
const handler1: Handler = () => {};
const handler2: Handler = () => {};


// 联合类型(满足其中一个即可验证通过)
type PossibleTypes = string | number | boolean;
// 字面量联合类型
type Status = 'success' | 'failure';
type Code = 200 | 404 | 502;


// 交叉类型(必须满足所有才可验证通过)
interface UserBasicInfo {}
interface UserJobInfo {}
interface UserFamilyInfo {}
type UserInfo = UserBasicInfo & UserJobInfo & UserFamilyInfo;


// 交叉类型与联合类型混用
type UnionIntersection = (1 | 2 | 3) & (1 | 2); // 1 | 2

  
